#pragma once
#include "../bytearray.h"
void gui_ctrl_set_attr_init(bytearray_t* ba, bytearray_t* segment, u32 handle);
void gui_ctrl_set_attrs(bytearray_t* ba, const char* format, ...);
void gui_ctrl_set_attr_flush(bytearray_t* ba, bytearray_t* segment);
#define ATTR(TYPE) __gui_attr_##TYPE
#define ATTR_TYPE(TYPE) ATTR(TYPE)##_t
#define ATTR_INIT(TYPE) const ATTR_TYPE(TYPE)  ATTR(TYPE) =

typedef enum {
	GUI_CVT_NONE = 0,
	GUI_CVT_UVAL2U32,
	GUI_CVT_UVAL2U16,
	GUI_CVT_UVAL2I32,
	GUI_CVT_UVAL2I16,
	GUI_CVT_STR2I32 = 0x5,
	GUI_CVT_STR2I16,
	GUI_CVT_STR2I8,
	GUI_CVT_STR2U32,
	GUI_CVT_STR2U16,
	GUI_CVT_STR2U8,
	GUI_CVT_IVAL2STR = 0x0B
}egui_cvt_t;

void gui_ctrl_iset(bytearray_t* ba, 
	u32 src_handle, u8 src_attr,
	u32 dst_handle, u8 dst_attr,
	egui_cvt_t cvt);

